class WebsitesController < ApplicationController
before_filter :authorize
    def update
    @article = Article.find(params[:article_id])
    @websitesinf = Websitesinf.find(params[:id])
    unless @article.has_websitesinf?(@websitesinf.name1)
      @article.websitesinfs << @websitesinf
    end
#    redirect_to :action => 'index'
    redirect_to :controller => 'adminwebsitearticles',:action => 'mytest',:id =>params[:article_id] 
  end
  
  def destroy

    @article = Article.find(params[:article_id])
    @websitesinf = Websitesinf.find(params[:id])
    if @article.has_websitesinf?(@websitesinf.name1)
      @article.websitesinfs.delete(@websitesinf)
    end
#    redirect_to :action => 'index'
    redirect_to :controller => 'adminwebsitearticles',:action => 'mytest',:id =>params[:article_id] 
  end 
end
